#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<assert.h>
using namespace std;


class Date
{
	friend ostream& operator<<(ostream& out, const Date& d);
	friend istream& operator>>(istream& in, Date& d);
public:
	
	Date(int year = 2025, int month = 9, int day = 9);
	void Print();
	int GetMonthDay(int year, int month)
	{
		assert(month > 0 && month < 13);
		int arr[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (year == 2 && (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		{
			return 29;
		}
		else
		{
			return arr[month];
		}
	}
	Date operator+(int day);
	Date& operator+=(int day);
	Date& operator++();
	Date  operator++(int);
	
	bool operator==(const Date& d);
	bool operator!=(const Date& d);
	int operator-(const Date& d);
	bool operator<(const Date& d);
	
private:
	int _year;
	int _month;
	int _day;

};
ostream& operator<<(ostream& out, const Date& d);
istream& operator>>(istream& in, Date& d);